const log = console.log.bind(console)

const e = function(selector) {
    return document.querySelector(selector)
}

const es = function(selector) {
    return document.querySelectorAll(selector)
}
const appendHtml = (element, html) => {
    element.insertAdjacentHTML('beforeend', html)
}
const prependHtml = (element, html) => {
    element.insertAdjacentHTML('afterbegin', html)
}
const arraySum = function(arr) {
    let sum = 0
    for (let i = 0; i < arr.length; i++) {
        sum += arr[i]
    }
    return sum
}
const subArray = function(multiArray, array) {
    for (let i = 0; i < multiArray.length; i++) {
        let s1 = JSON.stringify(multiArray[i])
        let s2 = JSON.stringify(array)
        if (s1 === s2) {
            return true
        }
    }
    return false
}
const arrayString = function(array) {
    let r = ''
    for (let i = 0; i < array.length; i++) {
        r = r + JSON.stringify(array[i]) + '\n'
    }
    return r
}
const logArray = function(message, arr) {
    log(message, arrayString(arr))
}